<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">

	<meta name="author" content="Kodinger">
	<title>表白墙后台登陆</title>
	<link rel="stylesheet" type="text/css" href="../assets/css/bootstrap.css">
	<link rel="stylesheet" type="text/css" href="../assets/css/my-login.css">
</head>
<body class="my-login-page">
	<section class="h-100">
		<div class="container h-100">
			<div class="row justify-content-md-center h-100">
				<div class="card-wrapper">
					<div class="brand">
						<img src="../assets/img/1.jpg">
					</div>
					<div class="card fat">
						<div class="card-body">
							<h4 class="card-title">登陆</h4>		 
								<div class="form-group">
									<label for="text">后台账号</label>
									<input id="username" type="text" class="form-control" required autofocus>
								</div>
								<div class="form-group">
									<label for="password">后台密码</label>
									<input id="password" type="password" class="form-control" required data-eye>
								</div>
								<div class="form-group">
									<label><input type="checkbox"> 记住密码</label>
								</div>
								<div class="form-group no-margin">
									<button type="button" class="btn btn-primary btn-block" id="ok">登陆</button>
								</div>
						</div>
					</div>
					<div class="footer">
						Copyright &copy; Company 2019 - More Templates <a href="http://www.cssmoban.com/" target="_blank">wuju</a> - Collect from wuju
					</div>
				</div>
			</div>
		</div>
	</section>
	<script src="../assets/js/jquery.min.js"></script>
	<script src="../assets/js/bootstrap.min.js"></script>
	<script src="../assets/layer/layer.js"></script>
	<script src="../assets/js/my-login.js"></script>
<script>

$("#ok").click(function(){
  $.post("../api.php?s=login",
    {
        user: $("#username").val(),
        pwd: $("#password").val()
    },
    function(data){
    	var json = JSON.parse(data);
    	if (json['code'] == 0) {
    		layer.alert(json['msg']);
    	}else{
    		layer.confirm(json['msg'], {

            btn: ["确定"],
            btn1:function(index,layero) {
              window.location.href="./";
            }
  			});
    	}
	});
}); 



</script>
</body>
</html>